#!/bin/bash
d=`date -d "-1 day" +%Y%m%d`
log_dir="/tmp/"
nginx_pid="/usr/local/nginx/logs/nginx.pid"
cd $log_dir
for log in `ls *.log`
do
    mv $log $log-$d
done
/bin/kill -HUP `cat $nginx_pid`